//
//  PKFollowsViewControllerCell.swift
//  Panku
//
//  Created by mac on 2017/2/13.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKFollowsViewControllerCell: PKBaseTableViewCell {

    //MARK: - properties
    //UI
    lazy var avatarView = UIImageView()
    lazy var nameView = UILabel()
    lazy var signatureView = UILabel()
    lazy var checkButton = PKBaseButton.createButton()
    
    lazy var genderView = UIImageView()
    lazy var rankButton = PKBaseButton.createButton()
    
    //MARK: - setupUI
    override func setupCell() {
        contentView.addSubview(avatarView)
        contentView.addSubview(nameView)
        contentView.addSubview(signatureView)
        contentView.addSubview(checkButton)
        contentView.addSubview(genderView)
        contentView.addSubview(rankButton)
        
        avatarView.image = R.image.mine_logo()
        avatarView.layer.masksToBounds = true
        avatarView.layer.cornerRadius = 18
        avatarView.layer.borderColor = UIColor.black.cgColor
        avatarView.layer.borderWidth = 1
        
        avatarView.backgroundColor = UIColor.black
        avatarView.snp.makeConstraints { (make) in
            make.width.equalTo(36)
            make.height.equalTo(36)
            make.left.equalTo(contentView.snp.left).offset(13)
            make.centerY.equalTo(contentView.snp.centerY)
        }
        
        nameView.font = UIFont.systemFont(ofSize: 15)
        nameView.text = "杨小于"
        nameView.textColor = UIColor.black
        nameView.snp.makeConstraints { (make) in
            make.top.equalTo(contentView.snp.top).offset(2)
            make.left.equalTo(avatarView.snp.right).offset(10)
        }
        
        signatureView.font = UIFont.systemFont(ofSize: 12)
        signatureView.text = "原谅我天生热血，把梦过成摇滚乐"
        signatureView.textColor = UIColor.darkGray
        signatureView.snp.makeConstraints { (make) in
            make.left.equalTo(nameView.snp.left)
            make.top.equalTo(nameView.snp.bottom).offset(2)
        }
        
        checkButton.setImage(R.image.banner2(), selectedImage: R.image.banner1()!)
        checkButton.addBlock(for: .touchUpInside) { (_) in
            //TODO:点击切换选择状态
            
        }
        
        checkButton.snp.makeConstraints { (make) in
            make.width.equalTo(16)
            make.height.equalTo(16)
            make.centerY.equalTo(contentView.snp.centerY)
            make.right.equalTo(contentView.snp.right).offset(-10)
        }
    }

}
